<template>
  <div id="main" class="app-main">
    <router-view></router-view>
  </div>
</template>

<script>
import { logOutApi } from './api/common';
import { getOtherSet } from './api';

export default {
  data() {
    return {};
  },
  computed: {
    mainTheme() {
      return this.$store.state.theme.theme.mainTheme;
    },
  },
  mounted() {
    this.changeMode();
      window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
  },
  beforeDestroy() {},
  methods: {
      beforeunloadHandler(){
          // // 在这里执行清除缓存的操作
          // sessionStorage.clear();  // 清除本地存储
          //  sessionStorage.clear();  // 清除会话存储，根据需要选择清除哪种存储
          // logOutApi()
          // // 退出登录
          // this.$store.commit('setLoading', true);
          // getOtherSet().then(res => {
          //     this.$store.commit('setLoading', false);
          //     if (res.result) {
          //         let domain = res.result.ssoDomain;
          //         Cookies.set('accessToken', '', {
          //             domain: domain,
          //             expires: 7
          //         });
          //     }
          //     this.$store.commit('logout', this);
          //     this.setStore('accessToken', '');
          //     // 强制刷新页面 重新加载router
          //     location.reload();
          // });

      },
    changeMode() {
      let v = this.mainTheme;
      if (v == "darkMode") {
        document.getElementsByTagName("body")[0].className = "darkMode";
      } else if (v == "weakMode") {
        document.getElementsByTagName("body")[0].className = "weakMode";
      } else {
        document.getElementsByTagName("body")[0].className = "";
      }
    },
  },
  watch: {
    mainTheme() {
      this.changeMode();
    },
  },
};
</script>

<style lang="less">
html,
body {
  width: 100%;
  height: 100%;
  background: #fff;
    font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, "微软雅黑", Arial, sans-serif,SimSun;
}
pre {
    font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, "微软雅黑", Arial, sans-serif,SimSun;
}


.el-icon-circle-close {
    color: white; /* 或者使用 #FFFFFF */
}
.el-image-viewer__next, .el-image-viewer__prev  {
    width: 80px;
    height: 80px;
}

.ivu-page-item-jump-next:after,
.ivu-page-item-jump-prev:after {
    content: "\2022\2022\2022" !important;
}

//全局删除滚动条显示
::-webkit-scrollbar {
    //outline: 1px solid #378cfe;
    overflow-x: scroll;
    height: 12px;
    width: 0px;
    z-index: 1000;
}
::-webkit-scrollbar-thumb {
  background-color: #378cfe; /* 设置滑块颜色 */
  border-radius: 30px;
  width: 260px;
}
.el-table__body-wrapper {
    &::-webkit-scrollbar { // 滚动条高 解决行未对齐
        height: 12px;
    }
}
.el-table__fixed-body-wrapper .el-table__body {
    padding-bottom: 12px; // 滚动条高度
}
.el-table__fixed-right {
    height: auto !important;
    bottom: 12px!important;//高度可调整到合适大小
}
//去掉固定列下方的横线，样式优化
.el-table__fixed::before, .el-table__fixed-right::before {
    display: none;
}


.app-main {
  width: 100%;
  height: 100%;
}

.br button {
  margin-right: 8px;
}

.operation button {
  margin-right: 8px;
}

.operation .brr button {
  margin-right: 0px !important;
}

.ivu-btn-text:focus {
  box-shadow: none !important;
}

.ivu-tag {
  cursor: pointer;
}

.block-tool .ivu-tooltip,
.block-tool .ivu-tooltip-rel {
  display: block;
}

.block-pop .ivu-poptip,
.block-pop .ivu-poptip-rel {
  display: block;
}

.form-noheight {
  .ivu-form-item-content {
    line-height: unset !important;
  }
}

.viewer-container {
  z-index: 2050 !important;
}

// 修改drawer层级 避免固定nav时遮挡
.ivu-drawer-mask,
.ivu-drawer-wrap {
  z-index: 1002;
}

// 修改Message层级
.ivu-message {
  z-index: 3600 !important;
}

// 暗黑
.darkMode {
  filter: invert(1) hue-rotate(180deg);
  transition: all 300ms;
  img,
  video {
    filter: invert(1) hue-rotate(180deg);
  }
}

// 色弱
.weakMode {
  touch-action: none;
  filter: invert(80%);
}

.ivu-modal {
  min-width: 30% !important;
}

</style>
<style>

/* 90 100% */


.ivu-table{
    overflow: auto;
}
 @media (max-width: 1920px) {

  .ivu-table .ivu-table-fixed-right{
    height: 98.5% !important;
  }
  .ivu-table .ivu-table-fixed-right  .ivu-table-fixed-body {
    height: 90% !important;
  }
}

@media (min-width: 1921px) and (max-width: 3440px) {
  .ivu-table .ivu-table-fixed-right{
    //height: 97.5% !important;
    height: 100% !important;
    //height:calc(100% - 12px)  !important;
  }
  .ivu-table .ivu-table-fixed-right  .ivu-table-fixed-body {
    //height: 93% !important;
    height: 100% !important;
    //height:calc(100% - 12px) !important;
  }
} 

	
.ivu-page {
  font-size: 14px !important;
 
}
.ivu-page .ivu-icon-ios-arrow-forward:before {
  font-size: 16px !important;
}
.ivu-page .ivu-icon-ios-arrow-back:before {
  font-size: 16px !important;
}
.ivu-page  .ivu-page-item {
  font-size: 14px !important;
}
.ivu-page .ivu-select-selected-value {
  font-size: 14px !important;
}
.el-table .sort-caret.ascending {
  top: 0px !important;
}
.el-table .sort-caret.descending {
  bottom: 2px !important;
}
</style>